<?php

require_once(WSB_XTENSION_PATH . 'simpleshop/models/DbTable/Basket/Table.php');

class Simpleshop_BasketController extends WSB_Xtension_Extension
{

	public function indexAction()
	{
		$table = new Simpleshop_Model_DbTable_Basket_Table();
		$rowset = $table->getRowset();

		$config = $this->getConfiguration();
		$shippingAndHandlingCosts = floatval($config->shippingAndHandlingCosts);

		$this->_view->checkoutPageId = empty($config->checkoutPageId) ? 0 : $config->checkoutPageId ;
		$this->_view->rowset = $rowset;
		$this->_view->shippingAndHandlingCosts = $shippingAndHandlingCosts;
		$this->_view->total = $rowset->getTotalPrice($shippingAndHandlingCosts);
		$this->_view->currency = $config->currency;

		$this->addContent($this->_view->render('basket/index.phtml'));
	}

}